* This file reads the raw data downloaded from the MEPS website, and combines the Consolidated files into one file containing all years. 
* It will then be merged with data on health shocks which is obtained from the Medical conditions files 


*********************************************************************************
*** MERGING CONSOLIDATED YEAR FILES *********************************************
*********************************************************************************
qui{
clear
use "${data_raw}\C1996.dta"
*Here, I want to make the variable names match those in the following years so I can merge them
renvars  duid- year , upper
renvars   DUID- VARPSU96, subst(96)
rename 	FAMID1	FAMID31
rename 	RULETTR1	RULETR31
rename 	RUSIZE1	RUSIZE31
rename 	RUCLASS1	RUCLAS31
rename 	FAMSIZE1	FAMSZE31
rename 	REGION1	REGION31
rename 	REFPERS1	REFPRS31
rename 	RESP1	RESP31
rename 	PROXY1	PROXY31
rename 	BEGREFD1	BEGRFD31
rename 	BEGREFM1	BEGRFM31
rename 	BEGREFY1	BEGRFY31
rename 	ENDREFD1	ENDRFD31
rename 	ENDREFM1	ENDRFM31
rename 	ENDREFY1	ENDRFY31
rename 	INSCOPE1	INSCOP31
rename 	ELIGRND1	ELGRND31
rename 	PSTATUS1	PSTATS31
rename 	RURSLT1	    RURSLT31
rename 	SPOUSID1	SPOUID31
rename 	SPOUSIN1	SPOUIN31
rename 	EDUCYR1	    EDUCYR31
rename 	HIGHDEG1	HIDEG31
rename 	ACTDUTY1	ACTDTY31
rename 	EMPST1	    EMPST31
rename 	RTEHLTH1	RTHLTH31
rename 	RTEPROX1	RTPROX31
rename 	MNTHLTH1	MNHLTH31
rename 	MNTPROX1	MNPROX31
rename 	IADLHLP1	IADLHP31
rename 	ADLHELP1	ADLHLP31
rename 	AIDHELP1	AIDHLP31
rename 	WALKLIM1	WLKLIM31
rename 	LIFTDIF1	LFTDIF31
rename 	STEPDIF1	STPDIF31
rename 	WALKDIF1	WLKDIF31
rename 	MILEDIF1	MILDIF31
rename 	STNDDIF1	STNDIF31
rename 	BENDDIF1	BENDIF31
rename 	RECHDIF1	RCHDIF31
rename 	FINGRDF1	FNGRDF31
rename 	ACTLIMT1	ACTLIM31
rename 	WRKLIMT1	WRKLIM31
rename 	HSELIMT1	HSELIM31
rename 	SCHLIMT1	SCHLIM31
rename 	UNABLE1	UNABLE31
rename 	SOCLIMT1	SOCLIM31
rename 	COGLIMT1	COGLIM31
rename 	NWK1	NWK31
rename 	SELFCM1	SELFCM31
rename 	PAYDR1	PAYDR31
rename 	SICPAY1	SICPAY31
rename 	PAYVAC1	PAYVAC31
rename 	RETPLN1	RETPLN31
rename 	MORE1	MORE31
rename 	JOBORG1	JOBORG31
rename 	BSNTY1	BSNTY31
rename 	HRWGIM1	HRWGIM31
rename 	HRHOW1	HRHOW31
rename 	CHOIC1	CHOIC31
rename 	HOUR1	HOUR31
rename 	NUMEMP1	NUMEMP31
rename 	CIND1	CIND31
rename 	COCCP1	COCCP31
rename 	UNION1	UNION31
rename 	SHFTWK1	SHFTWK31
rename 	ENDWK1	ENDWK31
rename 	STJBMM1	STJBMM31
rename 	STJBDD1	STJBDD31
rename 	STJBYY1	STJBYY31
rename 	MORJOB1	MORJOB31
rename	FAMID2	FAMID42
rename	RULETTR2	RULETTR42
rename	RUSIZE2	RUSIZE42
rename	RUCLASS2	RUCLASS42
rename	FAMSIZE2	FAMSIZE42
rename	REGION2	REGION42
rename	REFPERS2	REFPERS42
rename	RESP2	RESP42
rename	PROXY2	PROXY42
rename	BEGREFD2	BEGREFD42
rename	BEGREFM2	BEGREFM42
rename	BEGREFY2	BEGREFY42
rename	ENDREFD2	ENDREFD42
rename	ENDREFM2	ENDREFM42
rename	ENDREFY2	ENDREFY42
rename	INSCOPE2	INSCOPE42
rename	ELIGRND2	ELIGRND42
rename	PSTATUS2	PSTATUS42
rename	RURSLT2	RURSLT42
	rename	SPOUSID2	SPOUSID42
	rename	SPOUSIN2	SPOUSIN42
	rename	EDUCYR2	EDUCYR42
	rename	HIGHDEG2	HIGHDEG42
	rename	ACTDUTY2	ACTDUTY42
	rename	EMPST2	EMPST42
	rename	RTEHLTH2	RTEHLTH42
	rename	RTEPROX2	RTEPROX42
	rename	MNTHLTH2	MNTHLTH42
	rename	MNTPROX2	MNTPROX42
	rename	IADLHLP2	IADLHP42
	rename	ADLHELP2	ADLHLP42
	rename	NWK2	NWK42
	rename	SELFCM2	SELFCM42
	rename	PAYDR2	PAYDR42
	rename	SICPAY2	SICPAY42
	rename	PAYVAC2	PAYVAC42
	rename	RETPLN2	RETPLN42
	rename	MORE2	MORE42
	rename	JOBORG2	JOBORG42
	rename	BSNTY2	BSNTY42
	rename	HRWGIM2	HRWGIM42
	rename	HRHOW2	HRHOW42
	rename	CHOIC2	CHOIC42
	rename	HOUR2	HOUR42
	rename	NUMEMP2	NUMEMP42
	rename	CIND2	CIND42
	rename	COCCP2	COCCP42
	rename	UNION2	UNION42
	rename	SHFTWK2	SHFTWK42
	rename	ENDWK2	ENDWK42
	rename	STJBMM2	STJBMM42
	rename	STJBDD2	STJBDD42
	rename	STJBYY2	STJBYY42
	rename	MORJOB2	MORJOB42
renvars  BEGREF*, subs(REF RF)
renvars  ENDREF*, subs(REF RF)
renvars PSTATUS*, subs(ATUS ATS)
renvars WAGE*, subs(WAGE WAG)
renvars PENSPNX, subs(PENSPNX PENSPX )
renvars SSECPNX, subs(SSECPNX SSECPX  )
rename  SSIPNX SSIPX
rename  PUBPNX PUBPX
renvars DDNOWRK*, subs(NOWR NWR  )
renvars RTEHLTH*, subs(TEHL THL  )
renvars  MNTHLTH*, subs( MNTHLTH  MNHLTH  )
*drop variables that refer to children 0-17 only
drop MOMPROB2	DADPROB2	UNHAP2		SCHLBEH2	HAVEFUN2	ADULPRO2 	NERVAFR2		
drop SIBPROB2	KIDPROB2	SPORPRO2	SCHLPRO2	HOMEBEH2	TROUBLE2	
drop SPECSCH2	SPECED2		PROGTXT2	SPCHTHE2	PSYCNSL2	OCUPTHE2	
drop VOCSVCS2	TUTOR2		READINT2	PHYTHER2	LIFSKIL2	FAMCNS2	
drop RECTHER2	OTHSVC2		CANTSCH2	LMOTACT2	SPECIFL2	HEALTHY2	
drop NTHLTHY2	GETSICK2	HIGHTFT2	HIGHTIN2	WEIGHLB2	WEIGHOZ2	CHLDLIM2
drop LIMACT2	PLAYLIM2	CANTPLA2	SPECPRO2	DTPSHOT2	NUMDTP2	
drop POLIOSH2	NUMPOLI2	MMRSHOT2	HEPBSHT2
*drop variables related to pregnancy since we've kept only males
drop PREGRD1	PREGRD2	PREGRD3	NOWPREG1	NOWPREG2	NOWPREG3	LIVEBIR1	LIVEBIR2	LIVEBIR3	NUMPRG13	PREG	BIRTH
drop PAPSMER* BRSTEXA*  MAMOGRM*
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename  WTDPER WEIGHT
save "${data_raw_merge}\merge_C1996.dta", replace


clear
foreach num of numlist 97 98 {
global exper= "`num'"
use "${data_raw}\C19`num'.dta"
*Here, I want to make the variable names match those in the following years so I can merge them
renvars  duid- year , upper
renvars   DUID- VARPSU`num', subst(`num')
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename WTDPER WEIGHT
save "${data_raw_merge}\merge_C19`num'.dta", replace
clear
}
 * 
 
 clear
use "${data_raw}\C1999.dta"
*Here, I want to make the variable names match those in the following years so I can merge them
renvars  duid- year , upper
renvars   DUID- VARPSU99, subst(99)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
save "${data_raw_merge}\merge_C1999.dta", replace
clear
*
 
clear
foreach num of numlist 0 1 2 3 4 5 6 7 8 9{
global exper= "`num'"
use "${data_raw}\C200`num'.dta"
*Here, I want to make the variable names match those in the following years so I can merge them
renvars  duid- year , upper
renvars   DUID- YEAR, subst(0`num')
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
cap rename PERWT WEIGHT
cap rename PERWTF WEIGHT
save "${data_raw_merge}\merge_C200`num'.dta", replace
clear
}
*


clear
use "${data_raw}\C2010.dta"
*Here, I want to make the variable names match those in the following years so I can merge them
renvars  duid- year , upper
renvars   DUID- YEAR, subst(10)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
save "${data_raw_merge}\merge_C2010.dta", replace


clear
use "${data_raw}\C2011.dta"
gen YEAR=2011
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*gen ID=DUID*1000+PID
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(11)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
save "${data_raw_merge}\merge_C2011.dta", replace

*
clear
use "${data_raw}\C2012.dta"
gen YEAR=2012
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*gen ID=DUID*1000+PID
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(12)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop  CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
save "${data_raw_merge}\merge_C2012.dta", replace

*
clear
use "${data_raw}\C2013.dta"
gen YEAR=2013
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*gen ID=DUID*1000+PID
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(13)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
save "${data_raw_merge}\merge_C2013.dta", replace


*
clear
use "${data_raw}\C2014.dta"
gen YEAR=2014
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(14)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
save "${data_raw_merge}\merge_C2014.dta", replace


*
clear
use "${data_raw}\C2015.dta"
gen YEAR=2015
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(15)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
save "${data_raw_merge}\merge_C2015.dta", replace

*
clear
use "${data_raw}\C2016.dta"
gen YEAR=2016
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(16)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
save "${data_raw_merge}\merge_C2016.dta", replace


*
clear
use "${data_raw}\C2017.dta"
gen YEAR=2017
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(17)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
save "${data_raw_merge}\merge_C2017.dta", replace




clear
use "${data_raw}\C2018.dta"
gen YEAR=2018
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(18)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
rename ADBMI42 BMINDX53 // the rounds in which the questions are asked have chenged. But it does not matter for us. Round 2 is in year 1 (as was round 3) and round 4 is in year 2 (as was round 5)
rename DIABDX_M DIABDX
save "${data_raw_merge}\merge_C2018.dta", replace



clear
use "${data_raw}\C2019.dta"
gen YEAR=2019
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(19)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
//rename ADBMI42 BMINDX53
rename DIABDX_M18 DIABDX
save "${data_raw_merge}\merge_C2019.dta", replace


clear
use "${data_raw}\C2020.dta"
gen YEAR=2020
rename DUPERSID ID
destring ID, replace
destring RURSLT*, replace
*Here, I want to make the variable names match those in the following years so I can merge them
renvars   DUID- YEAR, subst(20)
renvars WAGE*, subs(WAGE WAG)
*drop variables that refer to children 0-17 only
cap drop LIMACT42	PLYLIM42	CANTPL42	SPCPRO42	DPTSHT42	NUMDPT42	POLSHT42	NUMPOL42	MMRSHT42	
cap drop HEPSHT42	MOMPRO42	DADPRO42	UNHAP42		SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	
cap drop KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42		SPCSCH42	SPECED42	SPCHTH42	PSYCNS42	
cap drop  OCUPTH42	VOCSVC42	TUTOR42		READIN42	PHYTHR42	LIFSKL42	FAMCNS42	RECTHR42	OTHSVC42	
cap drop  CANTSC42	LMOACT42	HLTHY42		NTHLTH42	GETSIC42	HGTFT42		HGTIN42		WGTLB42		WGTOZ42		CHLIM42
cap drop LSHLTH42	NEVILL42	SICEAS42	HLTHLF42	WRHLTH42	CHPMED42	CHPMHB42	CHPMCN42	CHSERV42	CHSRHB42	CHSRCN42	CHLIMI42	CHLIHB42	CHLICO42	CHTHER42	CHTHHB42	CHTHCO42	CHCOUN42	CHEMPB42	CSHCN42	MOMPRO42	DADPRO42	UNHAP42	SCHLBH42	HAVFUN42	ADUPRO42	NERVAF42	SIBPRO42	KIDPRO42	SPRPRO42	SCHPRO42	HOMEBH42	TRBLE42	CHILCR42	CHILWW42	CHRTCR42	CHRTWW42	CHAPPT42	CHNDCR42	CHNECP42	CHLIST42	CHEXPL42	CHRESP42	CHPRTM42	CHHECR42	CHSPEC42	CHPRRE42	MESHGT42	WHNHGT42	MESWGT42	WHNWGT42	CHBMIX42	MESVIS42	MESBPR42	WHNBPR42	DENTAL42	WHNDEN42	EATHLT42	WHNEAT42	PHYSCL42	WHNPHY42	HELMET42	WHNHEL42	VARIABLE	NOSMOK42	WHNSMK42	TIMALN42	SRTHRT53	THSYMP53	DRTHRT53	THANTB53	THSWAB53	THSYMF53	THSWBF53	THANTF53
*drop other variables we don't need
*drop FAMID* CPSFAMID*
drop RULET* RUCLAS* RUSIZE*
rename PERWTF WEIGHT
rename PHYEXE53 PHYACT53
rename  RACEV1X RACEX
rename RACETHX RACETHNX
rename ADBMI42 BMINDX53
rename DIABDX_M18 DIABDX
save "${data_raw_merge}\merge_C2020.dta", replace



clear 
set more off
use "${data_raw_merge}\merge_C1996.dta"
append using "${data_raw_merge}\merge_C1997.dta"
append using "${data_raw_merge}\merge_C1998.dta"
append using "${data_raw_merge}\merge_C1999.dta"
append using "${data_raw_merge}\merge_C2000.dta"
append using "${data_raw_merge}\merge_C2001.dta"
append using "${data_raw_merge}\merge_C2002.dta"
append using "${data_raw_merge}\merge_C2003.dta"
append using "${data_raw_merge}\merge_C2004.dta"
append using "${data_raw_merge}\merge_C2005.dta"
append using "${data_raw_merge}\merge_C2006.dta"
append using "${data_raw_merge}\merge_C2007.dta"
append using "${data_raw_merge}\merge_C2008.dta"
append using "${data_raw_merge}\merge_C2009.dta"
append using "${data_raw_merge}\merge_C2010.dta"
append using "${data_raw_merge}\merge_C2011.dta"
append using "${data_raw_merge}\merge_C2012.dta"
append using "${data_raw_merge}\merge_C2013.dta"
append using "${data_raw_merge}\merge_C2014.dta"
append using "${data_raw_merge}\merge_C2015.dta"
append using "${data_raw_merge}\merge_C2016.dta"
append using "${data_raw_merge}\merge_C2017.dta"
append using "${data_raw_merge}\merge_C2018.dta"
append using "${data_raw_merge}\merge_C2019.dta"
append using "${data_raw_merge}\merge_C2020.dta"
save "${data}\Consolidated_data_merged.dta", replace


}